<?php
    include("conn.php");
    //执行删除sql语句
    $sql = "delete from `课程` where `课程编号`='{$_GET['kid']}'";
    $result = mysqli_query($conn,$sql);
    if( $result ){
        echo "<script>alert('数据删除成功')</script>";
        header("Refresh:1;url=kecheng-list.php");
    }else{
        echo "数据删除失败".mysqli_error($conn);
    }
    //关闭数据连接
    mysqli_close( $conn );
?>